<template>
    <div class="list">
        <div class="goodsList">
            <div class="nav">
                <p>直播返场</p>
                <span>特卖小二为您精选好货</span>
            </div>
            <div class="proList">
                <List v-for="(v, index) in arr" :key="index" :img1="v.img1" :proname="v.proname" :originprice="v.originprice" :sales="v.sales" :flag="false" @click.native="goDetail1(v)"></List>
            </div>
        </div>
    </div>
</template>

<script>
import List from '@/components/xn/HomeCom/Goods/List.vue';
export default {
    name:"suggest",
    data(){
        return{
            arr:[]
        }
    },
    components:{
        List
    },
    methods:{
        goDetail1(v) {
         this.$router.push({
            path: '/detail',
            query: {
               delList: JSON.stringify(v)
            }
         })
        },
    },
    mounted(){
        this.$http({
            url:`http://118.178.238.19:3001/api/pro/recommendlist`,
            method:"get",
            params:{
                count:5
            }
        }).then(res=>{
            this.arr = res.data.data
            console.log(res.data.data)
        })
    }
}
</script>

<style lang="scss" scoped>
    .list {
        width: 100%;
        margin-top: 0.25rem;
        border-top: 0.01rem solid #bcbcbc;
    }
    .list .goodsList{
        width: 100%;
        border-top-left-radius: 0.45rem;
        border-top-right-radius: 0.45rem;
        background: #fff;
    }
    .list .goodsList .nav {
        height: 1.06rem;
        width: 7.17rem;
        margin: 0 auto 0.29rem;
        display: flex;
        align-items: flex-end;
    }
    .list .goodsList .nav p {
        color: #000;
        font-size: 0.36rem;
    }
    .list .goodsList .nav span {
        margin-left: 0.13rem;
        color: #a1a1a1;
        font-size: 0.24rem;
    }
    .list .goodsList .proList {
        width: 7.17rem;
        margin: auto;
        column-count: 2;
        background: #f5f5f5;
    }
</style>